/**
 * @param {number[]} nums
 * @return {number}
 */
var minMoves = function (nums) {
    // const minNum = Math.min(...nums);
    // let count = 0;
    // for (const num of nums) {
    //     count += num - minNum;
    // }
    // return count;
    return nums.reduce((last, now) => last + now - Math.min(...nums), 0)
};